package scu.maqiang.eigenvalue;

import scu.maqiang.mesh.Mesh2T3;
import scu.maqiang.mesh.MeshFormat;

public class SteklovEigenVlaue {

	public static void main(String[] args) {
		String dir = "SteklovEigenValue\\";
		String meshFile = dir + "RectangleHoleCompoMesh256.msh";
		Mesh2T3 mesh = new Mesh2T3();
		mesh.readMesh(MeshFormat.msh, meshFile);
		mesh.toTecplot(dir+ "RectangleHoleCompo.dat");
		
//		FES2T31 fs = new FES2T31(mesh);
//		int dofHeat = fs.GetNdof();
//		SRMatrix A = new SRMatrix(dofHeat);
//		SRMatrix B = new SRMatrix(dofHeat);
//		ScalarFunc kxxFunc = (xyz, label, param) -> label == 8? 1.0 : 0.05;
//		fs.assembleHeatStiff(new ScalarFunc[] {kxxFunc}, null, BVPType.COMMON, A);
//		fs.assembleHeatConvectSurface(new double[] {1.0}, BVPType.CONSIST_MATRIX, B, 11, 12, 13, 14);
//		double[] x = new double[dofHeat];
//		Arrays.fill(x, 1.0);
//		fs.applyBCZero(A, x, Direct.X, BCType.RCE, 1, 2, 3, 4);
//		EigenSSolver solver = new EigenSSolver();
//
//		int N = 10;
//		double[] D = new double[N];
//		double[][] V = new double[N][dofHeat];
//		solver.inversePowerTran_PCGSSOR(A, B, x, 2.0, N, D, V);
//		System.out.println(MVO.toString(D));
//		mesh.toTecplot(dir + "SteklovEigenVectors64.dat", V);
	}

}
